<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'edit';
$return=array();
if($_RQ['op']=='edit'){
	if($_RQ['postdata']){
		$postdata=get_postdata();
		$this->plugin_setting('setting',$postdata);
		exi('设置成功');
	}
	$item=$this->plugin_setting('setting');
    $item['nv_icon']=$item['nv_icon']?:'../addons/jy_shifu/resource/images/nv_icon.png';
    $item['map_icon']=$item['map_icon']?:'../addons/jy_shifu/resource/images/map_icon.png';
    $return['item']=$item;
	$return['status']=array('1'=>'开启','0'=>'关闭');
	$htmls=array(
		'type'=>'edit',
		'desc'=>'设置',
		'edits'=>array(
				array(
					'title'=>'基本信息',
					'list'=>array(
						array('type'=>'string','title'=>'平台名称','name'=>'title'),
						array('type'=>'switch','title'=>'是否要审核','name'=>'shifu_auto'),
						array('type'=>'switch','title'=>'手机号是否需要验证','name'=>'is_smscode'),
						//array('type'=>'switch','title'=>'支持师傅改价?','name'=>'isgaijia','help'=>'如果师傅可以改价（配合称重商品是改成实际价格）'),
						//array('type'=>'radio','title'=>'师傅佣金模式','name'=>'shifu_commission_type','options'=>'shifu_commission_types'),
						array('type'=>'string','title'=>'默认等级佣金','name'=>'shifu_fee','help'=>'填写数字表示固定佣金，填写%，表示按百分比计算佣金'),
						array('type'=>'unitstring','title'=>'提现费率设置','name'=>'shifu_rate','unit'=>'%','help'=>'例如利率为5，表示提现手续费要5%'),
						array('type'=>'string','title'=>'最小提现金额','name'=>'minmoney'),
						array('type'=>'unitstring','title'=>'可结算几天前的提成？','name'=>'cash_day','unit'=>'天'),
						array('type'=>'string','title'=>'师傅同时接单数量','name'=>'shifu_order_max'),
						array('type'=>'string','title'=>'定时推送下单时间大于多少秒的单子','name'=>'shifu_msgnotice_time'),
						array('type'=>'string','title'=>'自动完成已师傅后多少秒的订单','name'=>'shifu_msgnotice_finish'),
						array('type'=>'unitstring','unit'=>'分钟','title'=>'转单接单时间限制','name'=>'send_status13_time','help'=>'默认不限制，设置限制时间后，时间范围内师傅没接收订单，将自动取消！'),
						array('type'=>'tip','title'=>'【派单模式】：由具体的场景体来决定！默认是抢单模式！'),
						array('type'=>'radio','title'=>'下单师傅通知','name'=>'shifu_messagetype','options'=>'shifu_messagetypes','show'=>array('set_shifuuser',2),'help'=>'只有师傅抢单时才生效！'),
					)
				),
                array(
                    'title'=>'地图设置',
                    'list'=>array(
                        array('type'=>'image','title'=>'地图技师图标','name'=>'nv_icon'),
                        //array('type'=>'image','title'=>'地图定位图标','name'=>'map_icon'),
                    )
                ),
				array(
					'title'=>'申请协议',
					'list'=>array(
						array('type'=>'switch','title'=>'申请师傅需要审核?','name'=>'become_check'),
						array('type'=>'string','title'=>'协议名称','name'=>'applytitle'),
						array('type'=>'richtext','title'=>'协议内容','name'=>'applycontent'),			
						)
				),
			)
	);
	$return['htmls']=$htmls;
	$return['shifu_commission_types']=array('0'=>'以每单计算','1'=>'以每件商品计算');
	$return['set_shifuusers']=array(
		'0'=>'系统指派',
		'1'=>'店员指派',
		'2'=>'师傅抢单',
	);
	$return['shifu_messagetypes']=array('0'=>'不通知','1'=>'所有师傅','2'=>'最近师傅点');
	exi($return);
}
?>